package controller;

import javax.swing.JFrame;

import view.AuthorView;
import view.ProgramChairView;
import view.ReviewerView;
import view.SubProgramChairView;

import model.Conference;

public class FrameControl extends JFrame {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6185325200758204389L;
	private Conference conference;
	private String role;
	private String id;
	DataBaseInteactor inteactor;
	
	
	public FrameControl(String theId, String thePw, Conference conf, String role, DataBaseInteactor theInteactor) {
		super("Conference");
		this.id = theId;
		this.conference = conf;
		this.role = role;
		this.inteactor = theInteactor;
	}
	
	public void makeConfFrame() {
		if(role.equals("Program Chair")) {
			ProgramChairView pcv = new ProgramChairView(conference, inteactor, id);
			pcv.createProgramChairView();
		} else if (role.equals("SubProgram Chair")) {
			SubProgramChairView spcb = new SubProgramChairView(conference, inteactor, id);
			spcb.creatSubProgramChairView();
		} else if (role.equals("Reviewer")) {
			ReviewerView rv = new ReviewerView(conference, inteactor, id);
			rv.createReviewerView();
		} else if (role.equals("Author")) {
			AuthorView av = new AuthorView(conference, inteactor, id);
			av.createAuthorView();
		}
	}
}
